Cloud Native Infrastructure by Justin Garrison & Kris Nova

Cloud Native Infrastructure by Justin Garrison & Kris Nova

Author:Justin Garrison & Kris Nova
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2017-11-10T05:00:00+00:00


Note

A happy test is a test that exercises the positive case of a condition. In other words, it is a test that sends a valid API object to the application and ensures the application accepts the valid input. A sad test is a test that exercises the opposite case, or the negative case of a condition. Example 6-1 is an example of a sad test that sends an invalid API object to the application and ensures the application rejects the invalid input.

This new pattern makes testing infrastructure very quick, and usually inexpensive. An engineer can begin to develop a large arsenal of happy and sad tests for even the most bizarre application input. Furthermore, the testing collection can grow over time; in the unfortunate scenario where an impostor API object trickles through to the environment, an engineer can quickly add a test to prevent it from happening again.

Input validation is one of the most basic things to test. By writing simple validation into our application that checks for sane values, we can begin to filter out the input of our program. This also gives us an avenue in which it is easy to define meaningful errors and return an error quickly.

Validation offers confidence without making you wait for infrastructure to be mutated. This creates a faster feedback loop for engineers developing against the API.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.